package com.thoughtworks.turtlemock.filemover;

import java.io.File;

public class FileAdapter implements FileAdaptee {
    private File file;

    public FileAdapter(File file) {
        this.file = file;
    }

    public String getAbsolutePath() {
        return file.getAbsolutePath();
    }

    public FileAdaptee moveTo(String path) {
        File dest = new File(path);
        file.renameTo(dest);
        return new FileAdapter(dest);
    }

    public String getName() {
        return file.getName();
    }
}
